import doctor from '@/router/doctor/doctor'
import request from '@/utils/request'

const name = '/admin/user/KywUserController'

// 分页查询用户数据
export const pageKywUser = (pageNum, pageSize, user) => {
  return request({
    url: `${name}/pageKywUser/` + pageNum + "/" + pageSize,
    method: 'get',
    params: user
  })
}

// 添加用户
export const addKywUser = user => {
  return request({
    url: `${name}/addKywUser`,
    method: 'post',
    data: user,
  })
}

// 修改用户信息
export const updateKywUser = user => {
  return request({
    url: `${name}/updateKywUser`,
    method: 'put',
    data: user,
  })
}

// 根据id删除用户
export const deleteKywUser = id => {
  return request({
    url: `${name}/deleteKywUser/${id}`,
    method: 'delete',
  })
}

// 给岗位分配角色请求
export const addUserRole = (assginRoleVo) => {
  return request({
      url:  `${name}/addUserRole`,
      method: 'post',
      data: assginRoleVo
  })
}